3.1.88 \(\int \frac {A+B x+C x^2+D x^3}{x^2 (a+b x^2)} \, dx\)

Optimal. Leaf size=76 \[ -\frac {(A b-a C) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{3/2} \sqrt {b}}-\frac {A}{a x}-\frac {(b B-a D) \log \left (a+b x^2\right )}{2 a b}+\frac {B \log (x)}{a} \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {1802, 635, 205, 260} \begin {gather*} -\frac {(A b-a C) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{3/2} \sqrt {b}}-\frac {A}{a x}-\frac {(b B-a D) \log \left (a+b x^2\right )}{2 a b}+\frac {B \log (x)}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x + C*x^2 + D*x^3)/(x^2*(a + b*x^2)),x]

[Out]

-(A/(a*x)) - ((A*b - a*C)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(3/2)*Sqrt[b]) + (B*Log[x])/a - ((b*B - a*D)*Log[a +
 b*x^2])/(2*a*b)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {A+B x+C x^2+D x^3}{x^2 \left (a+b x^2\right )} \, dx &=\int \left (\frac {A}{a x^2}+\frac {B}{a x}+\frac {-A b+a C-(b B-a D) x}{a \left (a+b x^2\right )}\right ) \, dx\\ &=-\frac {A}{a x}+\frac {B \log (x)}{a}+\frac {\int \frac {-A b+a C-(b B-a D) x}{a+b x^2} \, dx}{a}\\ &=-\frac {A}{a x}+\frac {B \log (x)}{a}+\frac {(-A b+a C) \int \frac {1}{a+b x^2} \, dx}{a}+\frac {(-b B+a D) \int \frac {x}{a+b x^2} \, dx}{a}\\ &=-\frac {A}{a x}-\frac {(A b-a C) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{3/2} \sqrt {b}}+\frac {B \log (x)}{a}-\frac {(b B-a D) \log \left (a+b x^2\right )}{2 a b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 75, normalized size = 0.99 \begin {gather*} \frac {(a C-A b) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{3/2} \sqrt {b}}-\frac {A}{a x}+\frac {(a D-b B) \log \left (a+b x^2\right )}{2 a b}+\frac {B \log (x)}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x + C*x^2 + D*x^3)/(x^2*(a + b*x^2)),x]

[Out]

-(A/(a*x)) + ((-(A*b) + a*C)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(3/2)*Sqrt[b]) + (B*Log[x])/a + ((-(b*B) + a*D)*L
og[a + b*x^2])/(2*a*b)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A+B x+C x^2+D x^3}{x^2 \left (a+b x^2\right )} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(A + B*x + C*x^2 + D*x^3)/(x^2*(a + b*x^2)),x]

[Out]

IntegrateAlgebraic[(A + B*x + C*x^2 + D*x^3)/(x^2*(a + b*x^2)), x]

________________________________________________________________________________________

fricas [A]  time = 0.77, size = 165, normalized size = 2.17 \begin {gather*} \left [\frac {2 \, B a b x \log \relax (x) + {\left (C a - A b\right )} \sqrt {-a b} x \log \left (\frac {b x^{2} + 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) - 2 \, A a b + {\left (D a^{2} - B a b\right )} x \log \left (b x^{2} + a\right )}{2 \, a^{2} b x}, \frac {2 \, B a b x \log \relax (x) + 2 \, {\left (C a - A b\right )} \sqrt {a b} x \arctan \left (\frac {\sqrt {a b} x}{a}\right ) - 2 \, A a b + {\left (D a^{2} - B a b\right )} x \log \left (b x^{2} + a\right )}{2 \, a^{2} b x}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(2*B*a*b*x*log(x) + (C*a - A*b)*sqrt(-a*b)*x*log((b*x^2 + 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) - 2*A*a*b + (D
*a^2 - B*a*b)*x*log(b*x^2 + a))/(a^2*b*x), 1/2*(2*B*a*b*x*log(x) + 2*(C*a - A*b)*sqrt(a*b)*x*arctan(sqrt(a*b)*
x/a) - 2*A*a*b + (D*a^2 - B*a*b)*x*log(b*x^2 + a))/(a^2*b*x)]

________________________________________________________________________________________

giac [A]  time = 0.38, size = 68, normalized size = 0.89 \begin {gather*} \frac {B \log \left ({\left | x \right |}\right )}{a} + \frac {{\left (C a - A b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a} + \frac {{\left (D a - B b\right )} \log \left (b x^{2} + a\right )}{2 \, a b} - \frac {A}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a),x, algorithm="giac")

[Out]

B*log(abs(x))/a + (C*a - A*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a) + 1/2*(D*a - B*b)*log(b*x^2 + a)/(a*b) - A/(
a*x)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 83, normalized size = 1.09 \begin {gather*} -\frac {A b \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}\, a}+\frac {C \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b}}+\frac {B \ln \relax (x )}{a}-\frac {B \ln \left (b \,x^{2}+a \right )}{2 a}+\frac {D \ln \left (b \,x^{2}+a \right )}{2 b}-\frac {A}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a),x)

[Out]

-1/2*B/a*ln(b*x^2+a)+1/2/b*ln(b*x^2+a)*D-1/a/(a*b)^(1/2)*arctan(1/(a*b)^(1/2)*b*x)*A*b+1/(a*b)^(1/2)*arctan(1/
(a*b)^(1/2)*b*x)*C-A/a/x+B/a*ln(x)

________________________________________________________________________________________

maxima [A]  time = 3.00, size = 67, normalized size = 0.88 \begin {gather*} \frac {B \log \relax (x)}{a} + \frac {{\left (C a - A b\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a} + \frac {{\left (D a - B b\right )} \log \left (b x^{2} + a\right )}{2 \, a b} - \frac {A}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a),x, algorithm="maxima")

[Out]

B*log(x)/a + (C*a - A*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a) + 1/2*(D*a - B*b)*log(b*x^2 + a)/(a*b) - A/(a*x)

________________________________________________________________________________________

mupad [B]  time = 1.21, size = 78, normalized size = 1.03 \begin {gather*} \frac {\ln \left (b\,x^2+a\right )\,D}{2\,b}-\frac {A}{a\,x}-\frac {B\,\left (\ln \left (b\,x^2+a\right )-2\,\ln \relax (x)\right )}{2\,a}-\frac {A\,\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{a^{3/2}}+\frac {C\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {b}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x + C*x^2 + x^3*D)/(x^2*(a + b*x^2)),x)

[Out]

(log(a + b*x^2)*D)/(2*b) - A/(a*x) - (B*(log(a + b*x^2) - 2*log(x)))/(2*a) - (A*b^(1/2)*atan((b^(1/2)*x)/a^(1/
2)))/a^(3/2) + (C*atan((b^(1/2)*x)/a^(1/2)))/(a^(1/2)*b^(1/2))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((D*x**3+C*x**2+B*x+A)/x**2/(b*x**2+a),x)

[Out]

Timed out

________________________________________________________________________________________